import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintStream;

/**
 * @author zyj
 * @date 2022年06月11日 9:53
 */
public class 实现打印控制台 {
    public static void main(String[] args) {
//        System.out.println();
        //通过打印流来实现
        PrintStream ps = new PrintStream(System.out);
        ps.println("哈哈哈哈哈");


        //
        BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));

        try {
            writer.write("哈哈哈哈哈哈哈");
            writer.newLine();
            writer.flush();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
